#include "sdkGlobal.h"
#include "platform_global.h"
#include "platform_elec_sign.h"


typedef struct
{
    TransmitElecOnlineFunc mTransmitOnlineFunc;
    IsRecordEnableUploadFunc mRecordEnableUploadFunc;
    IsUploadSuccessErrCodeFunc mIsUploadSuccessErrCodeFunc;
    TransShowPlatformFunc mTransShowFunc;
    RecordPlatformFunc mRecordPlatformFunc;
    TransmitDataPlatformFunc mTransmitDataPlatformFunc;
    SignBlockFunc mSignBlockFunc;
} platform_elec_entity;

static platform_elec_entity g_platform_elec_entity;

void platform_elec_init()
{
    memset(&g_platform_elec_entity, 0x00, sizeof(platform_elec_entity));
}

void platform_elec_set_record_enable_upload_func(IsRecordEnableUploadFunc func)
{
    g_platform_elec_entity.mRecordEnableUploadFunc = func;
}

IsRecordEnableUploadFunc platform_elec_get_record_enable_upload_func()
{
    return g_platform_elec_entity.mRecordEnableUploadFunc;
}

void platform_elec_set_upload_success_err_code_func(IsUploadSuccessErrCodeFunc func)
{
    g_platform_elec_entity.mIsUploadSuccessErrCodeFunc = func;
}

IsUploadSuccessErrCodeFunc platform_elec_get_upload_success_err_code_func()
{
    return g_platform_elec_entity.mIsUploadSuccessErrCodeFunc;
}

void platform_elec_set_transmit_online_func(TransmitElecOnlineFunc func)
{
    g_platform_elec_entity.mTransmitOnlineFunc = func;
}

TransmitElecOnlineFunc platform_elec_get_transmit_online_func()
{
    return g_platform_elec_entity.mTransmitOnlineFunc;
}

void platform_elec_set_show_func(TransShowPlatformFunc *flowFunc)
{
    memcpy(&g_platform_elec_entity.mTransShowFunc, flowFunc, sizeof(TransShowPlatformFunc));
}

TransShowPlatformFunc *platform_elec_get_show_func()
{
    return &g_platform_elec_entity.mTransShowFunc;
}

void platform_elec_set_transmit_data_func(TransmitDataPlatformFunc *platformFunc)
{
    memcpy(&g_platform_elec_entity.mTransmitDataPlatformFunc, platformFunc, sizeof(TransmitDataPlatformFunc));
}

TransmitDataPlatformFunc *platform_elec_get_transmit_data_func()
{
    return &g_platform_elec_entity.mTransmitDataPlatformFunc;
}

void platform_elec_set_record_func(RecordPlatformFunc *platformFunc)
{
    memcpy(&g_platform_elec_entity.mRecordPlatformFunc, platformFunc, sizeof(RecordPlatformFunc));
}

RecordPlatformFunc *platform_elec_get_record_func()
{
    return &g_platform_elec_entity.mRecordPlatformFunc;
}

void platform_elec_set_sign_block_func(SignBlockFunc func)
{
    g_platform_elec_entity.mSignBlockFunc = func;
}

SignBlockFunc platform_elec_get_sign_block_func()
{
    return g_platform_elec_entity.mSignBlockFunc;
}

